1. Field of the Invention
This invention relates in general to sorting techniques, and in particular, to a method for accelerated sorting based on data format.
2. Description of Related Art
It is well known in the art to sort data for various reasons, and a number of different sorting methods are known. Consider, for example, the well-known treatise by Donald E. Knuth, entitled xe2x80x9cThe Art of Computer Programming, Volume 3, Searching and Sortingxe2x80x9d, Addison-Wesley Publishing Co., 1973. This treatise describes a number of different situations where sorting methods may be used, such as with lists, tables, trees, etc. It also describes a number of different sorting methods, such as quicksorts, merge sorts, etc.
It is not uncommon in the art for a first process to receive data from a second process and then sort the data before presenting it to a user. Unfortunately, the receiving process usually knows little about the received data, and thus tends to use the same sorting method, regardless of whether the received data is unsorted, partially sorted, or fully sorted. Obviously, this promotes sub-optimal performance, because the receiving process may spend unnecessary time in sorting data that does not need to be sorted.
What is needed then is a method for determining whether the data received by a process is either unsorted, partially sorted, or fully sorted, and selecting a sorting method (or not sorting) based on that determination. Such a method can result in substantial time savings and performance gains.
To overcome the limitations in the prior art described above, and to overcome other limitations that will become apparent upon reading and understanding the present specification, the present invention discloses a method, system, and article of manufacture for accelerated sorting based on data format, wherein the format is determined from known, derived, or empirical information indicating whether the data is an unordered format, in a partially ordered format, or in a fully ordered format, according to varying degrees of consistency or probability. Information used in making these determinations may include the receipt of an indicator from the sending process, the received data itself, a tracing or trending analysis performed on the received data, etc. Once a determination is made, more efficient sorting methods may be selected and used, or sorting may be avoided altogether.